from tortoise import fields

from .base import BaseModel, TimestampMixin


class Category(BaseModel, TimestampMixin):
    name = fields.CharField(max_length=200, unique=True, description="类别名称", index=True)
    code = fields.CharField(max_length=200, unique=True, default="", description="类别程编码", index=True)
    desc = fields.CharField(max_length=500, null=True, description="类别描述")
    status = fields.CharField(default='1', null=True, max_length=10, description="状态")
    order = fields.IntField(default=1, null=True, description="排序", index=True)


class Meta:
    table = "category"
